In geometry, the perpendicular distance from a point to the line ax + by + c = 0 is given by
If the equation of the line is given on the form y = kx + m, the perpendicular distance from is given by
Consider the line given by and a point . For ease, consider a point given by , where (since is on the line). Then we have
Here is simply the angle between the line and the -axis, such that
Using the Pythagorean theorem we have , and
This can be extended to the case where is any point on the line, however, one can always choose such that one coordinate is common to to simplify the formulation.
The general formula for higher dimensions can be quickly arrived at using vector notation. Let the hyperplane have equation , where the is a normal vector and is a position vector to a point in the hyperplane. We desire the orthogonal distance to the point . The hyperplane may also be represented by the scalar equation , for constants . Likewise, a corresponding may be represented as . The magnitude of the vector is like our distance above, so we desire the scalar projection in the direction of . Noting that (as satisfies the equation of the hyperplane) we have
Notice how the general expression is consistent with dimensions.